<template>
  <div class="OnlineRes">
    <div class="breadcrumb">数据库管理-人才管理</div>
    <div class="mes">
      <p>{{info.name}}</p>
      <p>
        <span>{{info.phone}}</span>
        <span>{{info.title}}</span>
        <span>{{info.jobState}}</span>
        <span>{{new Date(info.rdtime).format('yyyy-MM-dd')}}</span>
      </p>
    </div>
    <div class="maincontain">
      <div class="btn">
        <div class="graybtn" :class="{'bluebtn':tabs==0}" @click="changeTabs(0)">职业证书</div>
        <div class="graybtn" :class="{'bluebtn':tabs==1}" @click="changeTabs(1)">在线简历</div>
      </div>
      <!--人才信息-->
      <div v-if="tabs==1">
        <div class="Resume">
          <div class="userImg">
            <img :src="info.image" alt>
          </div>
          <div class="userInfo">
            <div class="age">
              <div class="userSize">{{info.name}}</div>
              <div class="userS">{{info.jobState}}</div>
            </div>
            <div class="age marginT">
              <div class="age">
                <div class="icon margin"></div>&nbsp;
                <div>{{info.age?info.age+' 岁':''}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div class="icon_experience margin"></div>&nbsp;
                <div>{{info.workDay?info.workDay+' 年经验':''}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div class="icon_positioning margin"></div>&nbsp;
                <div>{{info.city}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div class="icon_salary margin"></div>&nbsp;
                <div>{{info.tax==0?'税前':'税后'}} {{info.salaryPerMonth}}W/{{info.monthCount}}年</div>
              </div>
            </div>
            <div class="age marginT">
              <div class="age">
                <div class="icon_tel margin"></div>&nbsp;
                <div>{{info.phone}}</div>
              </div>
              <div class="empty"></div>
              <div class="age margin1">
                <div class="icon_email margin"></div>&nbsp;
                <div>{{info.email}}</div>
              </div>
            </div>
          </div>
        </div>
        <!--期望职位-->
        <div class="jobs">
          <div class="age">
            <div class="empty1 marginR"></div>
            <div class="header">期望职位</div>
          </div>
          <div class="age marginT1" v-for="(item,idx) in info.hopeJob" :key="idx">
            <div class="age">
              <div class="icon_positioning margin"></div>&nbsp;
              <div>{{item.hopeCity}}</div>
            </div>
            <div class="age margin1">
              <div class="icon_enter_type margin"></div>&nbsp;
              <div>{{item.hopeLicenseStr}}</div>
            </div>
            <div class="age margin1">
              <div class="icon_practice margin"></div>&nbsp;
              <div>{{item.hopeCompanyTypeStr}}</div>
            </div>
            <div class="age margin1">
              <div class="icon_salary1 margin"></div>&nbsp;
              <div>{{item.taxType==0?'税前':'税后'}} {{item.salaryPerMonthLow}} - {{item.salaryPerMonthHigh}}W/{{item.yearNum}}年</div>
            </div>
          </div>
        </div>
        <!--工作经历-->
        <div class="Work">
          <div class="age marginT2">
            <div class="empty1 marginR"></div>
            <div class="header">工作经历</div>
            <div class="bitian">必填</div>
          </div>
          <div v-for="(item,idx) in info.jobExperiences" :key="idx">
            <div>
              <div class="age marginT30 m_l_10">
                <div class="marginR1 company">{{item.companyName}}</div>
                <div class="workTime" v-html="item.rdtime"></div>
              </div>
            </div>
            <div class="age marginT m_l_10">
              <div class="age">
                <div>{{item.jobName}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div>{{item.licenseTypeStr}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div>{{item.companyTypeStr}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div>{{item.workCity}}</div>
              </div>
            </div>
            <div class="WorkCont m_l_10">
              {{item.jobContent}}
              <!-- 1、负责开工前地质勘察、三通一平、图纸会审，负责基础、主体、竣工验收、保修组织管理工作。<br>
                        2、协同施工单位根据合同及公司总体布置情况编制施工总进度计划，审查工程施工组织设计及施工方案，
                        负责控制土建工程项目的现场施工进度，确保土建工程项目进度计划的完成。
                        <br>
                        3、严格监督土建工程项目施工质量，参加土建工程检查验收，隐蔽验收及土建工
                        程材料、设备进场检查验收，对土建工程质量负完全责任。
                        <br>
                        4、严格监督控制土建工程项目施工成本，参加土建工程现场经济签证的审查确认，
              确保土建工程项目成本控制目标的实现。-->
            </div>
          </div>
        </div>
        <!-- 项目 -->
        <div class="Work">
          <div class="age marginT2">
            <div class="empty1 marginR"></div>
            <div class="header">项目经历</div>
            <div class="bitian">必填</div>
          </div>
          <div v-for="(item,idx) in info.projectExperience" :key="idx">
            <div>
              <div class="age marginT30 m_l_10">
                <div class="marginR1 company">{{item.projectName}}</div>
                <div class="workTime">{{item.projectStartTime}}-{{item.projectEndTime}}</div>
              </div>
            </div>
            <div class="WorkCont m_l_10" v-html="item.projectContent">
            </div>
          </div>
        </div>
        <!-- 执业证书 -->
        <div class="Work">
          <div class="age marginT2">
            <div class="empty1 marginR"></div>
            <div class="header">执业证书</div>
            <div class="bitian">必填</div>
          </div>
          <div class="age marginT30 m_l_10" v-for="(item,idx) in info.licenses" :key="idx">
            <div class="marginR1  major">{{item.licenseType}}</div>
            <div class="company">{{item.licenseNum}}</div>
          </div>
        </div>
        <!-- 教育经历 -->
        <div class="Work">
          <div class="age marginT2">
            <div class="empty1 marginR"></div>
            <div class="header">教育经历</div>
            <div class="bitian">必填</div>
          </div>
          <div v-for="(item,idx) in info.educationExperiences" :key="idx">
            <div>
              <div class="age marginT2 m_l_10">
                <div class="marginR1 company">{{item.school}}</div>
                <div class="workTime">{{item.startTime+'-'+item.endTime}}</div>
              </div>
            </div>
            <div class="age marginT m_l_10">
              <div class="age">
                <div>{{item.major}}</div>
                <div class="empty"></div>
              </div>
              <div class="age margin1">
                <div>{{item.academicStr}}</div>
              </div>
            </div>
          </div>
        </div>
        <!-- 职称 -->
        <div class="Work">
          <div class="age marginT2">
            <div class="empty1 marginR"></div>
            <div class="header">职称</div>
          </div>
          <div class="age marginT30 m_l_10"  v-for="(item,idx) in info.title.split(',')" :key="idx">
            <div class="marginR1 company">{{item}}</div>
          </div>
        </div>
      </div>
      <div v-if="tabs==0" class="certlist">
        <el-table
          header-row-class-name="tab_header"
          row-class-name="tableRow"
          :data="table.data"
          style="width: 100%">
          <el-table-column label="序号" width="100" type="index"></el-table-column>
          <el-table-column prop="name" label="姓名"></el-table-column>
          <el-table-column prop="licenseType" label="执业类型"></el-table-column>
          <el-table-column prop="licenseNum" label="证书编号"></el-table-column>
          <el-table-column prop="rdtime" label="提交时间"></el-table-column>
        </el-table>
        <!-- <p class="colred">最多三个最少一个，人才提交几个就显示几个</p> -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userImg: require('../../../assets/imgs/1.jpg'),
      info: {},
      tabs: 0,
      table: {
        data: [],
        total: 0
      }
    }
  },
  watch: {
    tabs(val) {
      console.log(val)
    }
  },
  created() {
    this._initData()
  },
  methods: {
    changeTabs(n) {
      this.tabs = n
    },
    _getTalent() {
      let params = {
        id: this.$route.query.id
      }
      this.lAxios({
        method: 'post', //方法
        url: '/platform/getTalent.do', //路径，基础路径在main.js里面配置
        params
      })
        .then(res => {
          //成功的回调函数
          this.info = res.data.data
          if(this.info.title==null){
            this.info.title="";
          }
        })
        .catch(err => {
          console.log(err)
        })
    },
    _getList() {
      let params = {
        talentId: this.$route.query.id
      }
      this.lAxios({
        method: 'post', //方法
        url: '/platform/getLicense.do', //路径，基础路径在main.js里面配置
        params
      }).then(res => {
          //成功的回调函数
          this.table.data = res.data.data
        })
        .catch(err => {
          console.log(err)
        })
    },
    _initData() {
      this._getTalent()
      this._getList()
    }
  }
}
</script>

<style lang="scss">
.OnlineRes {
  // position: relative;
  height: 100%;
  padding: 0 10px 10px;
  overflow-y: auto;
  .breadcrumb {
    margin: 10px 0;
    font-size: 14px;
    color: #333;
  }
  .mes {
    background-color: #fff;
    height: 60px;
    padding: 30px 50px;
    p {
      font-size: 18px;
      font-weight: 600;
      line-height: 30px;
      span {
        margin-right: 30px;
        font-size: 16px;
        font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
      }
    }
  }
  .maincontain {
    margin-top: 10px;
    background-color: #fff;
    padding: 20px 50px;
    .btn {
      margin-bottom: 50px;
      display: flex;
      flex-direction: row;
      .graybtn {
        cursor: pointer;
        margin-right: 20px;
        width: 160px;
        height: 50px;
        line-height: 50px;
        font-size: 16px;
        text-align: center;
        border: 1px solid rgb(230, 233, 252);
        border-radius: 5px;
        background-color: rgb(247, 249, 252);
        color: #1f2e4d;
      }
      .bluebtn {
        background-color: #37f;
        color: #fff;
      }
    }
    .Resume {
      // margin-bottom: 60px;
      width: 700px;
      height: 167px;
      display: flex;
      flex-direction: row;
      .userImg {
        width: 105px;
        height: 105px;
        margin-right: 20px;
        // margin-top: 32px;
        // margin-left: 30px;
        img {
          width: 100%;
        }
      }
      .userInfo {
        display: flex;
        flex-direction: column;
        text-align: left;
      }
      .userInfo > div {
        margin-bottom: 10px;
      }
    }
    .age {
      display: flex;
      flex-direction: row;
      align-items: center;
      font-size: 14px;
      color: #666;
      .userS {
        width: 144px;
        height: 24px;
        background-color: #4ab0cf;
        border-radius: 10px 10px 10px 0px;
        color: white;
        line-height: 24px;
        text-align: center;
        margin-left: 10px;
        // font-size: 14px;
      }
      .userSize {
        font-size: 24px;
        color: #333;
        font-weight: bold;
      }
      .fs12 {
        font-size: 12px;
      }
    }
    .jobs {
      display: flex;
      flex-direction: column;
    }
    .header {
      font-size: 18px;
      color: #333;
      font-weight: bold;
    }
    .bitian {
      margin-left: 10px;
      color: #ccc;
    }
    .company {
      font-size: 16px;
      color: #555;
      font-weight: bold;
    }
    .major {
      color: #333;
      font-size: 14px;
      font-weight: bold;
    }
    .icon {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/age.png') no-repeat;
      margin-top: 3px;
    }
    .icon_experience {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/experience.png')
        no-repeat;
      margin-top: 3px;
    }
    .icon_positioning {
      width: 15px;
      height: 16px;
      background: url('../../../assets/img/communication/address.png') no-repeat;
      margin-top: 3px;
    }
    .icon_salary {
      width: 16px;
      height: 15px;
      background: url('../../../assets/img/communication/salary.png') no-repeat;
      margin-top: 3px;
    }
    .icon_tel {
      width: 14px;
      height: 16px;
      background: url('../../../assets/img/communication/tel.png') no-repeat;
      margin-top: 3px;
    }
    .icon_email {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/email.png') no-repeat;
      margin-top: 3px;
    }
    .icon_practice {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/practice.png')
        no-repeat;
      margin-top: 3px;
    }
    .icon_enter_type {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/enter_type.png')
        no-repeat;
      margin-top: 3px;
    }
    .icon_salary1 {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/salary1.png') no-repeat;
      margin-top: 3px;
    }

    .margin {
      margin-right: 5px;
    }
    .margin1 {
      margin-left: 29px;
    }
    .empty,
    .empty1 {
      width: 2px;
      height: 15px;
      background: #aaa;
      margin-left: 30px;
      // margin-top: 4px;
    }
    .empty1 {
      margin-left: 0;
      background-color: #f09338;
    }
    .marginT {
      margin-top: 13px;
    }
    .m_l_10 {
      margin-left: 12px;
    }
    .marginT1 {
      margin-top: 20px;
    }
    .marginT2 {
      margin-top: 40px;
    }
    .marginT30 {
      margin-top: 30px;
    }
    .marginR {
      margin-right: 10px;
    }
    .marginL {
      margin-left: 39px;
    }
    .marginL1 {
      margin-left: 50px;
    }
    .marginR1 {
      margin-right: 30px;
    }

    .Work {
      width: 100%;
      // height: 338px;
      display: flex;
      flex-direction: column;
    }
    .workTime {
      color: #999;
      font-size: 12px;
      margin-top: 3px;
    }
    .WorkCont {
      // width: 600px;
      // height: 161px;
      margin-top: 18px;
      /*border: 1px solid #999;*/
      font-size: 14px;
      word-wrap: break-word;
      word-break: break-all;
      overflow: hidden;
      color: #666;
      line-height: 20px;
      text-align: left;
    }
    .bottom {
      position: fixed;
      bottom: 0;
      left: 36.8%;
      width: 798px;
      height: 78px;
      font-size: 14px;
      background-color: #fbfbff;
    }
    .bottomR {
      margin-right: 20px;
    }
    .font {
      width: 379px;
      height: 20px;
      margin-top: 29px;
      margin-left: 51px;
      text-align: left;
    }
    .icon_green {
      width: 16px;
      height: 14px;
      background: url('../../../assets/img/communication/invitation_green.jpg')
        no-repeat;
      margin-top: 3px;
      margin-right: 8px;
      z-index: 9;
    }
    .icon_gray,
    .icon_xiaoxi {
      width: 16px;
      height: 16px;
      background: url('../../../assets/img/communication/fit_black.jpg')
        no-repeat;
      margin-top: 3px;
      margin-right: 8px;
      z-index: 9;
    }
    .icon_xiaoxi {
      background: url('../../../assets/img/communication/xiaoxi_black.png')
        no-repeat;
    }
    .fontG {
      color: #009944;
    }
    .icon_position {
      position: absolute;
      right: 50px;
      bottom: 29px;
    }
  }
  .certlist {
    .tab_header {
      th {
        background-color: #e6e9f0;
        text-align: center;
      }
    }
    .tableRow {
      td {
        text-align: center;
      }
    }
    .colred {
      margin-top: 30px;
      text-align: center;
      color: red;
      font-size: 14px;
    }
  }
}
</style>
